package main

import "fmt"

func main() {
	var ch chan int
	ch = make(chan int, 5)
	for i := 0; i < 5; i++ {
		ch <- i
	}
	close(ch)
	for {
		var b int
		b, ok := <- ch
		fmt.Println(b, ok)
		if ok == false {
			break
		}
	}
}